package com.my.hp_hr.service;

import com.my.hp_hr.dao.HistoryDao;
import com.my.hp_hr.entity.Department;
import com.my.hp_hr.entity.Employee;
import com.my.hp_hr.entity.History;
import com.my.hp_hr.entity.Position;

import java.util.List;

public class HistoryService {
    private HistoryDao historyDao = new HistoryDao();

    public List<Employee> getWorkServlet(String pageNo) throws Exception {
        return historyDao.getWorkServlet(pageNo);
    }

    public int getTotal() throws Exception {
        return historyDao.getTotal();
    }

    public List<Position> getPosition() throws Exception {
        return historyDao.getPosition();
    }

    public List<Department> getDepartment() throws Exception {
        return historyDao.getDepartment();
    }

    public int getAllHistory() throws Exception {
        return historyDao.getAllHistory();
    }

    public void addHistory(String employeeNumber, String name, String password, String gender, String date, String telephone, String email, String address, String education, String departmentNumber, String positionNumber, String notes) throws Exception {
        historyDao.addHistory(employeeNumber,name,password,gender,date,telephone,email,address,education,departmentNumber,positionNumber,notes);
    }

    public Employee getEmployeeMsg(String id) throws Exception {
        return historyDao.getEmployeeMsg(id);
    }

    public void updateEmployee(String employeeNumber, String name, String password, String gender, String date, String telephone, String email, String address, String education, String departmentNumber, String positionNumber, String notes) throws Exception {
        historyDao.updateEmployee(employeeNumber,name,password,gender,date,telephone,email,address,education,departmentNumber,positionNumber,notes);
    }

    public void deleteEmployee(String id) throws Exception {
        historyDao.deleteEmployee(id);
    }
}
